<!-- MAIN CONTENT -->
<div id="content">
    <!--头部-->
    <div smart-include="sensor/views/sub-header.tpl.html"></div>
    <!--头部end-->
    <div class="clearfix">
        <div class="pull-left margin-right-20">
            <a class="btn btn-labeled btn-primary" data-toggle="modal" data-target="#addModal" ng-click="show_addbox()"> <span class="btn-label"><i class="glyphicon glyphicon-plus"></i></span>添加方案</a>
        </div>
    </div>
    <div id="content">
        <div class="row">
            <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6 playChart">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
                        <thead>
                            <tr>
                                <th style="width: 40%">操作</th>
                                <th class="text-align-center">方案名称</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="data in types">
                                <td>
                                    <button class='btn btn-xs btn-default' uib-tooltip='编辑' tooltip-append-to-body='true' data-toggle="modal" data-target="#editAlert" ng-click="Edit_pro(data)"><i class='fa fa-pencil'></i></button>
                                    <button class='btn btn-xs btn-default' uib-tooltip='删除' tooltip-append-to-body='true' data-toggle="modal" data-target="#delAlert" ng-click="showDelDialog(data.id)"><i class='fa fa-times'></i></button>
                                    <button class='btn btn-xs btn-default' uib-tooltip='查看' tooltip-append-to-body='true' data-toggle="modal" ng-click="jump_chart()"><i class='fa fa-eye'></i></button>
                                </td>
                                <td class="text-align-center">{{data.name}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="dt-toolbar-footer">
                    <tm-pagination conf="paginationConf"></tm-pagination>
                </div>
            </div>
            <div class="col-lg-9 col-md-9 col-sm-8 col-xs-8">
                <div class="clearfix">
                    <div class="pull-left">
                        <strong class="font-md lineHeight">请选择方案：</strong>
                    </div>
                    <div class="pull-left">
                        <select class="form-control" ng-model="planid" ng-change="selectPlan(planid)">
                            <option ng-repeat="plan in plans" value="{{plan.id}}">{{plan.name}}</option>
                            <option value="" selected hidden></option>
                        </select>
                    </div>
                    <!-- 图表 -->
                    <div class="pull-left" ng-hide="planview">
                        <strong class="pull-left font-md lineHeight" style="margin-right:20px">请选择图表类型:</strong>
                        <!--<label class="control-label">图表类型</label>-->
                        <div ng-repeat="chart in charts" class="pull-left">
                            <label class="checkbox-inline pull-left lineHeight" style="margin-right:20px">
                                <input class="check lineHeight" type="checkbox" ng-model="$parent.chartCheck[chart.id]" value="" disabled>{{chart.name}}
                            </label>
                        </div>
                    </div>
                   
                </div>
                <!-- 生成方案 -->
                <div class="pull-left" ng-hide="planview">
                    <button class=" btn plan btn-primary" disabled ng-click="play_plan()">
                        生成图表
                    </button>
                </div>
                <!-- 画图表 -->
                <div class="row" style="padding-top:20px">
                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 hidden-xs hidden-sm"></div>
                    <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" id="line_box">
                        <div style="width:100%;height:400%" id="line"></div>
                        <div class="col-sm-10" id="linefield"></div>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12" id="bar_box">
                        <div style="width:100%;height:400%" id="bar"></div>
                        <div class="col-sm-10" id="barfield"></div>
                    </div>
                    <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" id="pie_box">
                        <div style="width:100%;height:400%" id="pie"></div>
                        <div class="col-sm-10" id="piefield"></div>
                    </div>
                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 hidden-xs hidden-sm"></div>
                </div>
                <div class="row" id="planName" style="display:none;padding-top:20px">
                    <form class="form-horizontal">
                        <div class="col-lg-2 col-md-2 col-sm-2 col-lg-push-1 col-md-push-1" style="margin-left:14px;">
                            <input type="text" ng-model="addobj.name" class="form-control" value="" placeholder="方案名称" />
                        </div>
                    </form>
                    <!--保存方案-->
                    <div class="col-sm-1" ng-hide="planview" style="margin:0 40%">
                        <button class=" btn sureplan btn-primary" disabled ng-click="surePlan(id)">
                            确定方案
                        </button>
                    </div>
                </div>
            </div>
            <!-- end widget content -->

        </div>
    </div>
    <div class="modal fade in" id="delAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×
                    </button>
                    <h4 class="modal-title">信息</h4>
                </div>
                <div class="modal-body">
                    <p>
                        您确实要删除这条数据吗？
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="sure_del()">
                        确认
                    </button>
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
    <!-- end widget grid -->
</div>
<!-- END MAIN CONTENT -->
<script>
    var pagefunction = function () {
        // START AND FINISH DATE
        $('#startdate').datepicker({
            //dateFormat : 'dd.mm.yy',
            dateFormat: 'yy-mm-dd',
            prevText: '<i class="fa fa-chevron-left"></i>',
            nextText: '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
            dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
            dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
            dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
            onSelect: function (selectedDate) {
                $('#finishdate').datepicker('option', 'minDate', selectedDate);
            }
        });
    };
    pagefunction();
</script>